Range Expressions
Range expressions are used to create/define properties with values that iterate over a collection of values or randomly choose from a collection of values. These ranges are used in some of the looping mechanisms within DTF and can be very useful for defining special identifiers to be used during the looping that can make your test much easier to write. The table below explains each type of range expression and has an example on how to use it.
NameDescriptionExample
Sequential

Defines a list of elements using only the boundary elements and allows for a more condensed representation of a n interval. The syntax is: lowerlimit..upperlimit where lowerlimit is an integer representing the first element in the list and upperlimit is an integer representing the last element. All other elements are generated by adding 1 to the current element.

<for property="prop" range="1..10">
   
<log>Prop: ${prop}</log>
</for>

The above example will just print out each of those values that are separated by a coma.

Random

The range expression will iterate randomly over the range expression defined as an argument. The syntax is random(your_expression), where your_expression can be any of the already existing range expressions. Now this expression is a little trickier to use because since it will select elements in a random order it doesn't really have an end or a beginning so you want to use it carefully.

<sequence>
   
<createrange name="range" value="random(a,b,c,d1,e)" />
   
<for property="prop" range="1..5">
      
<log>Prop: ${range}</log>
   
</for>
</sequence>

The above example will print out 5 randomly chosen elements form the expression defined in the random expression.

Aggregate

There is a simple way of aggregating ranges with the use of the square brackets. By wrapping an existing range expression in those brackets you create a sub-expression, like so: [expression1][expression2]. With this new syntax you can create ranges with fixed parts that iterate over a value of possible numbers. Like in the examples.

<createrange name="range" value="[client][1..10]" />

The above range would have the values client1,client2,client3...client10.